package controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import service.AppService;
import POJO.App;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("/app")

public class AppController {
    @Resource
    private AppService appService;

    @RequestMapping("/login")
    public String Login(App app, HttpSession session) {
        App a = appService.login(app);
        if (a != null) {
            session.setAttribute("app", a);
            return "prelogin";
        }
        return "prelogin";
    }

}